﻿''' <summary>
''' 表示实现信息获取器的基类，所有的信息获取器都应继承此类而不是直接实现IInfoProvider接口
''' </summary>
''' <remarks></remarks>
Public MustInherit Class InfoProviderBase
    Inherits PropertyChangeBase
    Implements IInfoProvider
    ''' <summary>
    ''' 获取部件是否可以工作的信息
    ''' </summary>
    ''' <returns>可否工作状态</returns>
    ''' <remarks></remarks>
    Public MustOverride Function GetAvailability() As Boolean Implements IInfoProvider.GetAvailability
    ''' <summary>
    ''' 通过部件获取信息
    ''' </summary>
    ''' <returns>以信息名和内容组成的集合</returns>
    ''' <remarks></remarks>
    Public MustOverride Function GetInfo() As Dictionary(Of String, String) Implements IInfoProvider.GetInfo
    ''' <summary>
    ''' 在程序结束时调用，指示部件结束工作
    ''' </summary>
    ''' <remarks></remarks>
    Public MustOverride Sub ShutDown() Implements IInfoProvider.ShutDown
    ''' <summary>
    ''' 在程序开始时调用，指示部件开始工作
    ''' </summary>
    ''' <remarks></remarks>
    Public MustOverride Sub StartUp() Implements IInfoProvider.StartUp

    Private _IsUsing As Boolean
    Public Property IsUsing As Boolean Implements IInfoProvider.IsUsing
        Get
            Return _IsUsing
        End Get
        Set(ByVal value As Boolean)
            If _IsUsing <> value Then
                OnPropertyChanging("IsUsing")
                _IsUsing = value
                OnPropertyChanged("IsUsing")
            End If
        End Set
    End Property
End Class
